import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login')
  },
  {
    path: '/',
    component: () => import('@/views/layout'),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('@/views/home'),
        meta: {
          name: '首页'
        }
      },
      {
        path: '/my',
        name: 'my',
        component: () => import('@/views/my'),
        meta: {
          name: '我的'
        }
      },
      {
        path: '/video',
        name: 'video',
        component: () => import('@/views/video'),
        meta: {
          name: '视频'
        }
      },
      {
        path: '/message',
        name: 'message',
        component: () => import('@/views/message'),
        meta: {
          name: '消息'
        }
      },
    ]
  },
  {
    path: '*',
    name: 'not found',
    component: () => import('@/views/notfound')
  }
]

const router = new VueRouter({
  routes
})

export default router
